package com.atguigu.gmall.all.controller;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.order.client.OrderFeignClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.Map;

@Controller
public class OrderController {
    @Autowired
    private OrderFeignClient orderFeignClient;

    //去结算       控制器  页面返回String
    @GetMapping("trade.html")
    public String trade(Model model){
        //调用远程 service-order
        Result<Map<String, Object>> result = orderFeignClient.trade();
        //存储数据
        model.addAllAttributes(result.getData());
        return "order/trade";
    }
//   我的订单控制器
// 获取订单
//getOrderPageList(page, limit) {
//    return request({
//            url: this.api_name + `/auth/${page}/${limit}`,
//            method: 'get'
    @GetMapping("myOrder.html")
    public String myOrder(){
        return "order/myOrder";
    }
}
